//
//  SLPageProtocol.h
//  SLPageView
//
//  Created by 王胜利 on 2018/11/9.
//  Copyright © 2018 wsl. All rights reserved.
//  Page标题栏协议和内容区域协议(扩展其他样式标题栏或内容区域，需实现以下两个协议)
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class SLPageEntity;

NS_ASSUME_NONNULL_BEGIN

@protocol SLPageProtocol <NSObject>

/// 标题数组
@property (nonatomic, strong) NSArray <SLPageEntity *>*pageEntitys;
/// 当前选中的下标
@property (nonatomic, assign) NSUInteger currentIdx;
/// 滑动到对应的Idx
- (void)scrollToIndex:(NSInteger)idx animated:(BOOL)animated;


@optional
/// 标题点击事件回调
@property (nonatomic, copy) void(^titleBtnSelect)(NSInteger idx);
/// 修改标题Badge
- (void)titleBadge:(NSString *)badge idx:(NSInteger)idx;
/// 是否显示标题红点
- (void)isShowRedPoint:(BOOL)isShow idx:(NSInteger)idx;

@end

@protocol SLPageContentProtocol <NSObject>

/// 标题数组
@property (nonatomic, strong) NSArray <UIView *>*childViews;
/// 当前选中的下标
@property (nonatomic, assign) NSUInteger currentIdx;
/// 滑动到对应的Idx
- (void)scrollToIndex:(NSInteger)idx animated:(BOOL)animated;

@optional
/// 内容区域滑动页数回调函数
@property (nonatomic, copy)void(^didScrollToIdx)(NSInteger idx);
/// 从某一个滑到某一个
@property (nonatomic, copy)void(^didScrollFromToIdx)(NSInteger fromIdx,NSInteger toIdx);

@end

NS_ASSUME_NONNULL_END
